
<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
 
    <canvas id="myCanvas" width="400" height="400"></canvas>
 
<script>
    var canvas = document.getElementById('myCanvas');
if (canvas.getContext) {
        var ctx = canvas.getContext('2d');
        ctx.lineWidth = 1;
        ctx.beginPath();
        ctx.moveTo(55.5, 5);
        ctx.lineTo(55.5, 140);
        ctx.stroke();
}else{
        console.log('浏览器不支持canvas')
}
</script>
 
</body>
</html>
